import time
def ab(nums):
    swapped=True
    while swapped:
        swapped=False
        for i in range(len(m1)-1):
            if nums[i]>nums[i+1]:
                nums[i], nums[i+1]=nums[i+1], nums[i]
                swapped=True

def aa(filename):
    file=open(filename, "r")
    data=file.readlines()
    return data

m1= aa ("m1_sorted.txt")
ts=time.time()
ab(m1)
tf=time.time()
print("m1_sorted", round((tf-ts)*1000),"milliseconds")

m2= aa ("m2_reverse.txt")
ts=time.time()
ab(m2)
tf=time.time()
print("m2_reverse", round((tf-ts)*1000),"milliseconds")

m3= aa ("m3_shuffle.txt")
ts=time.time()
ab(m3)
tf=time.time()
print("m3_shuffle", round((tf-ts)*1000),"milliseconds")


